package org.mapwar.web.config;

import org.mapwar.server.persistence.config.DbConfig;
import org.mapwar.service.config.ServiceConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.core.Ordered;
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * Created by zhebinwang on 2017/9/27.
 */

@Configuration
@EnableWebMvc
//@Import({})
@ComponentScan(basePackages = {
        "org.mapwar.server.persistence.dao"
        })

public class WebConfiguration extends WebMvcConfigurerAdapter {

        @Override
        public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
                configurer.enable();
        }


 /*   @Bean
    public ServerManager getConnectorManager() {
        System.out.println("启动");
        ServerManager serverManager= new ServerManager();
        System.out.println("启动0");
        return serverManager;
    }*/

        @Bean
        public AppContexConfig appContexConfig() {
                return new AppContexConfig();
        }

        @Override
        public void addViewControllers(ViewControllerRegistry registry) {
                registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
        }



}


